package sw6.pc;

import java.io.*;
import java.net.*;

import sw6.pc.network.STest;
import sw6.pc.network.Server;


public class Main {

	/**
	 * @param args
	 * @throws IOException 
	 * @throws ClassNotFoundException 
	 * @throws IllegalAccessException 
	 * @throws InstantiationException 
	 * @throws InterruptedException 
	 */
	public static void main(String[] args) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, InterruptedException {
		//File file = new File("Run2_lib/TestJar.jar");		
		//URL url = file.toURI().toURL();
		//URL[] urls = new URL[]{url};
		//ClassLoader cl = new URLClassLoader(urls);

		//Class cls = cl.loadClass("Test.Implementation");
		//IPlugin plugin = (IPlugin)cls.newInstance();
		
		//System.out.println(plugin.HvadHedderJeg());
		

		
		System.out.println("Waiting for client....");
		
		Server server = new Server();
		
		while(true)
		{
			server.broadcastIPAddress("230.0.0.1", 4446);
			System.out.println("Broadcasted");
			Thread.sleep(1000);
		}
		//server.startServer(5000);
		
		//if (server.isClientConnected() == true)
		//	System.out.println("Client connected!");
		//else
		//	System.out.println("Client could not connect");
		
		//byte read = server.getInputStream().readByte();
		
		//System.out.println(Byte.toString(read));
		//String text = server.readString();
		//STest st = server.readObject(STest.class);
		//System.out.println(((STest)st).HvadHedderJeg());
		
		//server.close();
		//System.out.println("Server closed!");
	}
}
